<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <div>{{num}}</div>
    <button @click="handle1(1,$event)">点击吧</button>
    <button @click="handle2">事件对象</button>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    /* 
      @事件绑定
        事件参数
        事件对象
          不传递参数时,默认第一个参数为事件对象
          若传参数时,需在最后加一个参数$event
    */
    const vm = new Vue({
      el: "#app",
      data: { 
        num: 1
      },
      methods: {
        handle1(i, event) {
          this.num++;
          console.log(i);
          console.log(event);
        },
        handle2() {
          console.log(event);
        }
      }
    });

  </script>
</body>

</html>
